import axios from '../utils/myaxios'

export const getArticleList = (params) => {
  return axios({
    url: '/post',
    params
  })
}

export const getCateList = () => {
  return axios({
    url: '/category'
  })
}

export const publishPost = (data) => {
  return axios({
    method: 'post',
    url: '/post',
    data
  })
}

export const getArticleById = (id) => {
  return axios({
    url: `/post/${id}`
  })
}

// 编辑文章
export const eidArticleById = (id, data) => {
  return axios({
    method: 'post',
    url: `/post_update/${id}`,
    data
  })
}
